<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta name="format-detection" content="telephone=no">
    <meta name="author" content="得闲技术 Team">
    <meta name="copyright" content="得闲技术">
    <title>组织架构列表 - Powered By 得闲技术</title>
    [#include "/admin/main/resources/list.ftl"/]
</head>
<body class="admin secondary">
<main>
    <div class="container-fluid">
        [#assign activeBreadcrumb= "组织架构"/]
        [#include  "/admin/main/breadcrumb.ftl"/]
        <form action="list" method="get">

            <div class="panel panel-default">
                <div class="panel-heading">
                    <div class="row">
                        <div class="col-xs-12 col-sm-7">
                            <div class="btn-group">
                                [@hasPermission name="department:save" ]
                                    <a class="btn btn-default" href="save" data-redirect-url="list">
                                        <i class="iconfont icon-add"></i>添加
                                    </a>
                                [/@hasPermission]
                                <button class="btn btn-default" type="button" data-action="refresh">
                                    <i class="iconfont icon-refresh"></i>刷新
                                </button>

                                <a class="btn btn-primary">
                                    共
                                    [#if tree??]
                                        ${tree?size}
                                    [#else]
                                        0
                                    [/#if]
                                    条数据
                                </a>
                            </div>
                        </div>

                    </div>
                </div>
                <div class="panel-body padding-10">
                    <div class="table-responsive">
                        <table class="table table-hover">
                            <thead>
                            <tr>
                                <th>
                                    <a href="javascript:;">
                                        名称
                                    </a>
                                </th>
                                <th>
                                    <a href="javascript:;">
                                        启用
                                    </a>
                                </th>
                                <th>
                                    <a href="javascript:;">
                                        排序
                                    </a>
                                </th>
                                <th>
                                    <a href="javascript:;">
                                        创建时间
                                    </a>
                                </th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            [#list tree as content]
                                <tr>
                                    <td>
                                        [#list 0..content.grade as i]
                                            &nbsp;
                                        [/#list]
                                        ${content.name}
                                    </td>
                                    <td>
                                        [#if content.isEnabled]
                                            <i class="text-green iconfont icon-check"></i>
                                        [#else]
                                            <i class="text-danger iconfont icon-close"></i>
                                        [/#if]
                                    </td>
                                    <td>
                                        ${content.order!}
                                    </td>
                                    <td>
                                        <span title="${(content.createDate?string(" yyyy-MM-dd HH:mm:ss"))!}"
                                                data-toggle="tooltip">
                                            ${(content.createDate?string("yyyy-MM-dd"))!}
                                        </span>
                                    </td>
                                    <td>

                                        [@hasPermission name="department:update" ]
                                            <a class="btn btn-default btn-xs btn-icon"
                                                    href="update?id=${content.id}" data-redirect-url="list">
                                                <i class="iconfont icon-write"></i> 编辑
                                            </a>
                                        [/@hasPermission]

                                        [@hasPermission name="department:delete" ]
                                            <a class="btn btn-default btn-xs btn-icon" data-action="delete-single"
                                                    data-id="${content.id}">
                                                <i class="iconfont icon-close"></i>删除
                                            </a>
                                        [/@hasPermission]

                                    </td>
                                </tr>
                            [/#list]
                            </tbody>
                        </table>
                    </div>
                </div>
                [@pagination pageNumber=page.pageNumber totalPages = page.totalPages]
                    [#include "/admin/main/list/pagination.ftl" /]
                [/@pagination]
            </div>
        </form>
    </div>
</main>

</body>
</html>
